home *** CD-ROM | disk | FTP | other *** search
- Path: news.xnet.com!news-admin
- From: kd9fb@xnet.com (Peter Mikalajunas)
- Newsgroups: comp.lang.c++
- Subject: Re: Randomize
- Date: Fri, 08 Mar 1996 04:54:11 GMT
- Organization: XNet - A Full Service Internet Provider - (708) 983-6064
- Message-ID: <4hoe9f$r0n@flood.xnet.com>
- References: <313BD7D1.6143@IntNet.net>
- NNTP-Posting-Host: monsoon.xnet.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- Dave Cohoon <kahuna@IntNet.net> wrote:
-
- >I have been learning C++ from books for the last 3 months, untill the next semester rolls around.
- >I've been working with "Teach Yourself C++ in 21 days" by Jesse Liberty.
-
- >2 questions as follows:
-
- >(1) I cannot find a way to create a randomized int, this is one of the simplest functions in
- > basic, but in C++, I have no idea. Please Help.
-
- #include <time.h>
- #define MAX 20
-
- int irand()
- {
- time_t t;
- srand((unsigned) time(&t)+1);
- return (int)(rand() % MAX);
- }
-
-
- >(2) As mentioned above, I have been studying c++, I have been able comprehend the commands and
- > general jist, but even after spending copious amounts of time on a chapter,and writing sample
- > code to help memorize it, I find that I am still having to turn back 200 pages or so to
- > refresh myself on something. Is this "par for the course", or am I just not cracked up to
- > learn this stuff???
-
- It all depends. If you constantly have to lookup cout, then things
- are not going well. On the other hand, if you are merely referencing
- library calls, or syntax, then this is common.
-
- > I was planning on taking a few coarses when school starts back up, in hope that one day I
- > might actually program professionally, but it seems like I can never learn enough to complete
- > the programs I'm working on. Is there ever an end?
-
- No, if you intend to program for a living, and continue to advance,
- then continuing education in one form or another is part of the job.
-
- >P.S.----recently heard a few rumors that JAVA will probably be the future standard for the
- >windows environment, Does this seem to be a true prediction, and if so, How different is it from
- >C++
-
- Only in the dreams of certain engineers working at SUN.
- The tool sets available to programmers in windows will
- never be limited to only one language.
-
- kd9fb@xnet.com
- http://www.xnet.com/~kd9fb
-
-